/*

	Sprite.h
	
	Sprite class used for drawing 2D textures 
	directly to the screen.	Uses OpenGL quads 
	drawn with an orthogonal view.
	
	Written by Sigurd Suhm 2009

*/

#ifndef _SPRITE_H
#define _SPRITE_H

// Includes
#include "Texture.h"		// Texture class header
#include "Vector.h"			// Vector types
#include "IDevice.h"		// Graphics device header

namespace EraAstral
{
	namespace graphics
	{
		// Sprite class definition
		class Sprite
		{
			private:
				// Sprite texture
				Texture 	*m_texture;
				
				// Sprite position
				Vector2		*m_position;
				// Sprite scale
				Vector2		*m_scale;
				// Sprite layer value - Highest layer value will be drawn in front (last)
				float		m_layer;
				
			public:
				// Default constructor
				Sprite();
				// Default destructor
				~Sprite();
				
				// Loads a texture for the sprite
				int	 LoadTexture(const char *fileName);
				// Draws the sprite to the screen
				void Draw();
				
				// Accessors
				Vector2		*GetPosition() const;
				void		SetPosition(const Vector2& position);
				Vector2		*GetScale() const;
				void		SetScale(const Vector2& scale);
				float		GetLayer() const;
				void		SetLayer(float layer);
				void		SetTexture(Texture *texture);
		};
	}
}

#endif		// _SPRITE_H
